<script setup>
import SonCom from '@/components/son-com.vue';
import { ref } from 'vue';
const money = ref(10)

const addMoney = () => {
    money.value++;
}
const changeFn = (data) => {
    money.value = data;
}
</script>

<template>

    <div>
        <div>父组件 - {{ money }}</div>
        <button @click="addMoney">挣钱</button>
        <SonCom @changeMoney="changeFn" car="car" :money="money"></SonCom>
    </div>

</template>